Skip to content

Conversation

jokemanfire
Copy link
Collaborator

The dynamic registration can be skipped, and it should be optional.

Motivation and Context

Accoding to rfc8414.

How Has This Been Tested?

No test

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@github-actions github-actions bot added T-core Core library changes T-examples Example code changes T-transport Transport layer changes labels Sep 30, 2025
authorization_endpoint: create_endpoint("authorize"),
token_endpoint: create_endpoint("token"),
registration_endpoint: create_endpoint("register"),
registration_endpoint: None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that supporting DCR is a SHOULD in the MCP spec, If we cannot get metadata at all and we construct these defaults, should we continue to populate a default uri here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It aimed to achieve better compatibility with the RFC 8414 protocol, according to the rfc 8414 , it should be optional
image
.
And in the spec file ,the registrat should be alt in the picture, and user can setting the client ID by himself which we provide this interface ,
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub, for example, does not provide a value for registration_endpoint in their response, as they do not support DCR and require pre-registration of clients. (I had to make this same change in a fork, to support GitHub properly, and had not yet had an opportunity to open a PR here.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

@jokemanfire
Copy link
Collaborator Author

#461

@4t145 4t145 requested a review from Copilot October 10, 2025 11:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes dynamic client registration optional in the OAuth implementation, aligning with RFC 8414 standards. The change allows systems to function without supporting dynamic registration by providing appropriate fallback behavior.

  • Changed registration_endpoint from required String to Option<String>
  • Added graceful fallback when dynamic registration is not supported
  • Improved logging to use warnings instead of errors for expected fallback scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
examples/servers/src/complex_auth_sse.rs Wraps registration endpoint in Some() to match new optional type
crates/rmcp/src/transport/auth.rs Updates struct definition, fallback logic, and error handling for optional registration
Comments suppressed due to low confidence (2)

crates/rmcp/src/transport/auth.rs:398

  • Removed error logging for HTTP status failures. Registration failures with specific HTTP status codes should be logged to help diagnose server-side issues.
            return Err(AuthError::RegistrationFailed(format!(
                "HTTP {}: {}",
                status, error_text
            )));

crates/rmcp/src/transport/auth.rs:408

  • Removed error logging for JSON parsing failures. When the server returns an unparseable response, this should be logged as it indicates a protocol violation or server issue.
            Err(e) => {
                return Err(AuthError::RegistrationFailed(format!(
                    "analyze response error: {}",
                    e
                )));

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jokemanfire
Copy link
Collaborator Author

@4t145 Did you forget submit your review? :)

@4t145
Copy link
Collaborator

4t145 commented Oct 13, 2025

approved

@alexhancock
Copy link
Contributor

LGTM as well after adjusting commit message to satisfy the linter

@alexhancock alexhancock self-requested a review October 13, 2025 17:05
@jokemanfire jokemanfire merged commit 6cd779c into modelcontextprotocol:main Oct 14, 2025
10 of 11 checks passed
@jokemanfire jokemanfire deleted the oauth branch October 14, 2025 01:30
@jokemanfire
Copy link
Collaborator Author

LGTM as well after adjusting commit message to satisfy the linter

Change it while merge .

@jokemanfire jokemanfire restored the oauth branch October 15, 2025 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-examples Example code changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants